package com.hzdl.car.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hzdl.car.bean.*;
import com.hzdl.car.mapper.CheckMapper;
import com.hzdl.car.service.CheckService;
import com.hzdl.car.vo.CarVo;
import com.hzdl.car.vo.CheckVo;
import com.hzdl.car.vo.RentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CheckServiceimpl implements CheckService {
    @Autowired
    private CheckMapper mapper;
    @Override
    public Rent findById(String rentid) {
        return mapper.findById(rentid) ;
    }

    @Override
    public Customer findByidentity(String rentid) {
        return mapper.findByidentity(rentid);
    }

    @Override
    public int add(CheckVo checkVo) {
        return mapper.add(checkVo);
    }

    @Override
    public int rentidUpdate(RentVo rentVo) {
        return mapper.rentidUpdate(rentVo);
    }

    @Override
    public int carnumberUpdate(CarVo carVo) {
        return mapper.carnumberUpdate(carVo);
    }

    @Override
    public Car findRentandCar(String rentid) {
        return mapper.findRentandCar(rentid);
    }

    @Override
    public int rentUpdate(String rentid) {
        return mapper.rentUpdate(rentid);
    }

    @Override
    public int carnumberUpdate1(String carnumber) {
        return mapper.carnumberUpdate1(carnumber);
    }

    @Override
    public PageInfo<Check> findWhere(CheckVo checkVo) {
        PageHelper.startPage(checkVo.getPage(),checkVo.getLimit());
        List<Check> list = mapper.findWhere(checkVo);
        return new  PageInfo<>(list);
    }

    @Override
    public int update(CheckVo checkVo) {
        return mapper.update(checkVo);
    }

    @Override
    public int delete(String checkid) {
        return mapper.delete(checkid);
    }
}
